import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.scene.text.Font;

public class SimpleGuiWithFont extends Application {

    @Override
    public void start(Stage primaryStage) {
        Label label = new Label("Hello, World!");

        Font font = Font.loadFont("/userdata/fonts/hywh.ttf", 24);
        label.setFont(font);


        Button button = new Button("Click Me");


        button.setOnAction(e -> {
            label.setText("Button Clicked!");
        });

        VBox layout = new VBox(10);
        layout.setPadding(new Insets(10));
        layout.getChildren().addAll(label, button);

        Scene scene = new Scene(layout, 320, 170);

        
        primaryStage.setTitle("Simple GUI with Font");
        primaryStage.setScene(scene);

        primaryStage.show();

    }

    public static void main(String[] args) {
        launch(args);
    }
}









